/**
 * Copyright (C), 2015-2020, XXX有限公司
 * FileName: ListenedUser
 * Author:   ZX
 * Date:     2020/7/27 18:32
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package org.example.listener;

import lombok.Data;

import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author ZX
 * @create 2020/7/27
 * @since 1.0.0
 */
@Data
public class ListenedUser implements HttpSessionBindingListener {
    private int id;
    private String username;
    private String password;
    private String nickname;

    public ListenedUser(){
        super();
    }
    public ListenedUser(int id){
        super();
        this.id=id;
    }

    public ListenedUser(int id,String username,String password,String nickname){
        super();
        this.id=id;
        this.username=username;
        this.password=password;
        this.nickname=nickname;
    }

    @Override
    public void valueBound(HttpSessionBindingEvent event){
        System.out.println("用户["+this.username+"]已经登录.");
    }

    @Override
    public void valueUnbound(HttpSessionBindingEvent event){
        System.out.println("用户["+this.username+"]已经注销.");
    }
}